<template>
	<view class="container">
		<view class="header">

		</view>
		<view class="content">
			<view class="avatar">
				<image src="https://q-api.guguzi.com/api/file/download/I1h1CefyYD_头像.png" mode="" class="icon">
					</image>
			</view>
			<view class="title">
				无人机学员
			</view>
			<view class="tips">
				坚持每天练10题,快速通过考试不费劲
			</view>
			<view class="flex">
				<view class="left">
					<view class="num">
						{{days}}天
					</view>
					<view class="text">
						已坚持
					</view>
				</view>
				<view class="right">
					<view class="num">
						10题
					</view>
					<view class="text">
					 今日题目
					</view>
				</view>
			</view>
			<image src="https://q-api.guguzi.com/api/file/download/S4JxkgwMPz_5f1155f0-07f3-4886-830c-9229dcc39b31.png" mode="" class="img"></image>
		</view>
		<view class="btn" @tap="toQuestion2">
			开始练习
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive,
		unref,
		toRaw,
		toRefs,
		nextTick
	} from 'vue'
	import {
		onInit,
		onLoad,
		onReady,
		onShow,
		onHide,
		onUnload,
		onResize,
	} from '@dcloudio/uni-app'
	import {
		$http,
		toLogin,
		timestampToDateTime
	} from "@/common"
	const days = ref(0)
	onLoad((options) => {
      
	})
	onShow((options) => {
       $http.get('trainDays').then(res=>{
		   days.value = res
	   })
	})
	function toQuestion2() {
		uni.navigateTo({
			url: '/pages/home/question2'
		})
	}
</script>
<style lang="scss" scoped>
	.container {
		height: 100%;
		background-color: #F9F9F9;

		.header {
			width: 100%;
			height: 300rpx;
			background: linear-gradient(to bottom, #1667EA, #F9F9F9);
		}

		.content {
			display: flex;
			flex-direction: column;
			align-items: center;
			padding: 30rpx 100rpx;
			width: 700rpx;
			margin: -220rpx auto;
			background-color: #fff;
			border-radius: 20rpx;

			.avatar {
				position: relative;
				top: -80rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				background: #fff;
				width: 120rpx;
				height: 120rpx;
				border-radius: 50%;
			}

			.icon {
				width: 100rpx;
				height: 100rpx;
			}

			.title {
				font-size: 34rpx;
				text-align: center;
				margin: -60rpx 0 30rpx 0;
			}
			.tips{
				color: #778899;
			}
			.flex{
				display: flex;
				width: 100%;
				justify-content: space-between;
			    padding:40rpx;
				.left,.right{
					text-align: center;
				}
				.num{
					font-weight: bold;
					font-size: 38rpx;
					margin-bottom: 10rpx;
				}
			}
			.img{
				width: 354rpx;
				height: 240rpx;
				margin: 0 auto;
			}
		}

		.btn {
			width: 620rpx;
			height: 80rpx;
			color: #fff;
			font-size: 32rpx;
			font-weight: bold;
			border-radius: 16rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			margin: 281rpx auto 0rpx auto;
			background-color: #1667EA;
		}
	}
</style>